package com.xuan.webfinally.mapper;

import com.xuan.webfinally.entity.SlopeDeviceInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 边坡设备信息表 Mapper 接口
 * </p>
 *
 * @author gyuxuan
 * @since 2025-05-18
 */
public interface SlopeDeviceInfoMapper extends BaseMapper<SlopeDeviceInfo> {


    @Select("select count(*) from slope_device_info where device_name = '裂缝设备' and dept_id = #{deptid}")
    int selectLiefengnumber(Long deptId);


    @Select("select count(*) from slope_device_info where device_name = '倾角设备' and dept_id = #{deptid}")
    int selectQingxienumber(Long deptId);


    @Select("select count(*) from slope_device_info where device_name = '次声设备' and dept_id = #{deptid}")
    int selectZhenDongNumber(Long deptId);
    @Select("select count(*) from slope_device_info where dept_id = #{deptId} and comm_status = '预警'")
    int getWay(Long deptId);


    @Select("select count(*) from slope_device_info where comm_status = '预警'")
    int getWays();
    @Select("select count(*) from slope_device_info where dept_id = #{deptId} and comm_status = '离线'")
    int getLx(Long deptId);

    @Select("select count(*) from slope_device_info where dept_id = #{deptId} and comm_status = '正常'")
    int getZc(Long deptId);

    @Select("select count(*) from slope_device_info where comm_status = '离线'")
    int selectLixian();

    @Select("select count(*) from slope_device_info where comm_status = '预警'")
    int selectZaixian();

    @Select("select count(*) from slope_device_info")
    int selectTotalCountDevice();

    @Select("select count(*) from slope_device_info where device_name = '裂缝设备'")
    int selectLiefengnumbers();


    @Select("select count(*) from slope_device_info where device_name = '倾角设备'")
    int selectQingxienumbers();


    @Select("select count(*) from slope_device_info where device_name = '次声设备'")
    int selectZhenDongNumbers();
}
